-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(order): use correct order when multiple chunk groups are merged #246
Conversation
Yes! This fix my problem. But i'm not sure if we should warn in the console. Do we want the user to take any action to fix this, if shared chunks is used in different order? |
Yes, the user should make sure to reorder the imports to avoid conflicting order. When a warning is emitted the code doesn't define multiple possible orderings. We choose one possible order here, but some other factors could make us choosing another ordering (i. e. adding entrypoints or import()s). The new order could result in a broken CSS. Conclusion: A conflicting order makes your app fragile and should be avoided. |
I agree, but it will be very hard to use reusable components (like in react) this way. Example: Text.js ComponentOne ComponentTwo I think it will be almost impossible to order this the right way if a component is reused in many other components. What do you think? |
We're finding warnings in our application since we started optimizing with SplitChunksPlugin, and having a hard time fixing them. Just starting to dig through the code here. Does the comparison function check index of the import, like this: file 1
file 2
or comparative order, like this? file 1
file 2
|
The way we use modules in practice, I'm not sure we'll be able to get rid of these warnings. We have pages that use many of the same modules, but imported via different means. For an extremely reduced example:
This doesn't have any practical impact since we use CSS modules, making our CSS non-order dependent. Thoughts? Maybe we can silence warnings for any CSS that uses generated unique scoping? |
After reading some of the comments in #250 I think my team will silence warnings. Apologies for the noise. |
This PR contains a:
Motivation / Use-Case
see #242
Order of modules is incorrect/undefined when merging multiple chunk groups into a single chunk.
This PR also emits a warning when order is conflicting between chunk groups.
Breaking Changes
bugfix
Additional Info